﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/MainForm.master" AutoEventWireup="true" CodeFile="Home.aspx.cs" Inherits="Views_Home" %>

<asp:Content ID="Content1" ContentPlaceHolderID="header" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Title" Runat="Server">
    All Book
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentRight" Runat="Server">
    <asp:GridView ID="gvAllBook" runat="server" AllowPaging="True" 
    AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" 
    BorderStyle="None" BorderWidth="1px" CellPadding="3" 
    DataSourceID="sqlDsAllBook" GridLines="Vertical" PageSize="4" Width="100%">
    <AlternatingRowStyle BackColor="#DCDCDC" />
    <Columns>
        <asp:TemplateField HeaderText="Image" SortExpression="Image">
            <EditItemTemplate>
                <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Image") %>'></asp:TextBox>
            </EditItemTemplate>
            <ItemTemplate>
                <asp:Image ID="Image1" runat="server" Height="100px" 
                    ImageUrl='<%# "../Images/"+Eval("Image") %>' />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Title" SortExpression="Title">
            <EditItemTemplate>
                <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Title") %>'></asp:TextBox>
            </EditItemTemplate>
            <ItemTemplate>
                <asp:HyperLink ID="HyperLink7" runat="server" 
                    NavigateUrl='<%# "BookDetails.aspx?ID="+Eval("ID") %>' 
                    Text='<%# Eval("Title") %>'></asp:HyperLink>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField="Author" HeaderText="Author" 
            SortExpression="Author" />
        <asp:TemplateField HeaderText="CategoryName" SortExpression="CategoryName">
            <EditItemTemplate>
                <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("CategoryName") %>'></asp:TextBox>
            </EditItemTemplate>
            <ItemTemplate>
                <asp:HyperLink ID="HyperLink8" runat="server" 
                    NavigateUrl='<%# "Category.aspx?ID="+Eval("CategoryID") %>' 
                    Text='<%# Eval("CategoryName") %>'></asp:HyperLink>
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
    <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
    <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
    <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
    <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
    <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
    <SortedAscendingCellStyle BackColor="#F1F1F1" />
    <SortedAscendingHeaderStyle BackColor="#0000A9" />
    <SortedDescendingCellStyle BackColor="#CAC9C9" />
    <SortedDescendingHeaderStyle BackColor="#000065" />
</asp:GridView>
<asp:SqlDataSource ID="sqlDsAllBook" runat="server" 
    ConnectionString="<%$ ConnectionStrings:conStr %>" 
    ProviderName="<%$ ConnectionStrings:conStr.ProviderName %>" 
    
        SelectCommand="SELECT Book.Title,Book.ID, Book.Author, Book.Image, Category.CategoryName,CategoryID FROM Book INNER JOIN Category ON Book.CategoryID = Category.ID WHERE (Book.BookStatus = 'True')">
</asp:SqlDataSource>
</asp:Content>

